@echo off
::g++编译工具路径
set compiletool=C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\g++.exe

::代码的名称(.cpp的名称)
set /p pname=the name of [.cpp .in] the same without extension: 
::测试用例数量
set /p fcnt=please input the cout of test file:  


::编译代码
del %pname%.exe
echo generating exe........
"%compiletool%" -o %pname%.exe %pname%.cpp
IF ERRORLEVEL 1 goto exit

for /l %%i in (1, 1, %fcnt%) do (
echo %pname%%%i.in
:: 拷贝测试输入文件
copy /y %pname%%%i.in %pname%.in
%pname%.exe
copy /y %pname%.out %pname%%%i.ans
del %pname%.in %pname%.out
)
del %pname%.exe

:exit
pause
exit